\(\int \frac {3+\tan (x)}{\sqrt {4+3 \tan (x)}} \, dx\) [375]

   Optimal result
   Rubi [A] (verified)
   Mathematica [C] (verified)
   Maple [B] (verified)
   Fricas [A] (verification not implemented)
   Sympy [F]
   Maxima [F]
   Giac [B] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 15, antiderivative size = 30 \[ \int \frac {3+\tan (x)}{\sqrt {4+3 \tan (x)}} \, dx=-\sqrt {2} \arctan \left (\frac {1-3 \tan (x)}{\sqrt {2} \sqrt {4+3 \tan (x)}}\right ) \]

[Out]

-arctan(1/2*(1-3*tan(x))*2^(1/2)/(4+3*tan(x))^(1/2))*2^(1/2)

Rubi [A] (verified)

Time = 0.04 (sec) , antiderivative size = 30, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.133, Rules used = {3616, 209} \[ \int \frac {3+\tan (x)}{\sqrt {4+3 \tan (x)}} \, dx=-\sqrt {2} \arctan \left (\frac {1-3 \tan (x)}{\sqrt {2} \sqrt {3 \tan (x)+4}}\right ) \]

[In]

Int[(3 + Tan[x])/Sqrt[4 + 3*Tan[x]],x]

[Out]

-(Sqrt[2]*ArcTan[(1 - 3*Tan[x])/(Sqrt[2]*Sqrt[4 + 3*Tan[x]])])

Rule 209

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[b, 2]))*ArcTan[Rt[b, 2]*(x/Rt[a, 2])], x] /;
 FreeQ[{a, b}, x] && PosQ[a/b] && (GtQ[a, 0] || GtQ[b, 0])

Rule 3616

Int[((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)])/Sqrt[(a_) + (b_.)*tan[(e_.) + (f_.)*(x_)]], x_Symbol] :> Dist[-2*(
d^2/f), Subst[Int[1/(2*b*c*d - 4*a*d^2 + x^2), x], x, (b*c - 2*a*d - b*d*Tan[e + f*x])/Sqrt[a + b*Tan[e + f*x]
]], x] /; FreeQ[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d, 0] && NeQ[a^2 + b^2, 0] && NeQ[c^2 + d^2, 0] && EqQ[2
*a*c*d - b*(c^2 - d^2), 0]

Rubi steps \begin{align*} \text {integral}& = -\left (2 \text {Subst}\left (\int \frac {1}{2+x^2} \, dx,x,\frac {1-3 \tan (x)}{\sqrt {4+3 \tan (x)}}\right )\right ) \\ & = -\sqrt {2} \arctan \left (\frac {1-3 \tan (x)}{\sqrt {2} \sqrt {4+3 \tan (x)}}\right ) \\ \end{align*}

Mathematica [C] (verified)

Result contains complex when optimal does not.

Time = 0.77 (sec) , antiderivative size = 61, normalized size of antiderivative = 2.03 \[ \int \frac {3+\tan (x)}{\sqrt {4+3 \tan (x)}} \, dx=-\frac {(1+3 i) \text {arctanh}\left (\frac {\sqrt {4+3 \tan (x)}}{\sqrt {4-3 i}}\right )}{\sqrt {4-3 i}}-\frac {(1-3 i) \text {arctanh}\left (\frac {\sqrt {4+3 \tan (x)}}{\sqrt {4+3 i}}\right )}{\sqrt {4+3 i}} \]

[In]

Integrate[(3 + Tan[x])/Sqrt[4 + 3*Tan[x]],x]

[Out]

((-1 - 3*I)*ArcTanh[Sqrt[4 + 3*Tan[x]]/Sqrt[4 - 3*I]])/Sqrt[4 - 3*I] - ((1 - 3*I)*ArcTanh[Sqrt[4 + 3*Tan[x]]/S
qrt[4 + 3*I]])/Sqrt[4 + 3*I]

Maple [B] (verified)

Leaf count of result is larger than twice the leaf count of optimal. \(53\) vs. \(2(25)=50\).

Time = 0.22 (sec) , antiderivative size = 54, normalized size of antiderivative = 1.80

method result size
derivativedivides \(\sqrt {2}\, \arctan \left (\frac {\left (2 \sqrt {4+3 \tan \left (x \right )}-3 \sqrt {2}\right ) \sqrt {2}}{2}\right )+\sqrt {2}\, \arctan \left (\frac {\left (2 \sqrt {4+3 \tan \left (x \right )}+3 \sqrt {2}\right ) \sqrt {2}}{2}\right )\) \(54\)
default \(\sqrt {2}\, \arctan \left (\frac {\left (2 \sqrt {4+3 \tan \left (x \right )}-3 \sqrt {2}\right ) \sqrt {2}}{2}\right )+\sqrt {2}\, \arctan \left (\frac {\left (2 \sqrt {4+3 \tan \left (x \right )}+3 \sqrt {2}\right ) \sqrt {2}}{2}\right )\) \(54\)
parts \(\sqrt {2}\, \arctan \left (\frac {\left (2 \sqrt {4+3 \tan \left (x \right )}-3 \sqrt {2}\right ) \sqrt {2}}{2}\right )+\sqrt {2}\, \arctan \left (\frac {\left (2 \sqrt {4+3 \tan \left (x \right )}+3 \sqrt {2}\right ) \sqrt {2}}{2}\right )\) \(54\)

[In]

int((3+tan(x))/(4+3*tan(x))^(1/2),x,method=_RETURNVERBOSE)

[Out]

2^(1/2)*arctan(1/2*(2*(4+3*tan(x))^(1/2)-3*2^(1/2))*2^(1/2))+2^(1/2)*arctan(1/2*(2*(4+3*tan(x))^(1/2)+3*2^(1/2
))*2^(1/2))

Fricas [A] (verification not implemented)

none

Time = 0.25 (sec) , antiderivative size = 28, normalized size of antiderivative = 0.93 \[ \int \frac {3+\tan (x)}{\sqrt {4+3 \tan (x)}} \, dx=\sqrt {2} \arctan \left (\frac {3 \, \sqrt {2} \tan \left (x\right ) - \sqrt {2}}{2 \, \sqrt {3 \, \tan \left (x\right ) + 4}}\right ) \]

[In]

integrate((3+tan(x))/(4+3*tan(x))^(1/2),x, algorithm="fricas")

[Out]

sqrt(2)*arctan(1/2*(3*sqrt(2)*tan(x) - sqrt(2))/sqrt(3*tan(x) + 4))

Sympy [F]

\[ \int \frac {3+\tan (x)}{\sqrt {4+3 \tan (x)}} \, dx=\int \frac {\tan {\left (x \right )} + 3}{\sqrt {3 \tan {\left (x \right )} + 4}}\, dx \]

[In]

integrate((3+tan(x))/(4+3*tan(x))**(1/2),x)

[Out]

Integral((tan(x) + 3)/sqrt(3*tan(x) + 4), x)

Maxima [F]

\[ \int \frac {3+\tan (x)}{\sqrt {4+3 \tan (x)}} \, dx=\int { \frac {\tan \left (x\right ) + 3}{\sqrt {3 \, \tan \left (x\right ) + 4}} \,d x } \]

[In]

integrate((3+tan(x))/(4+3*tan(x))^(1/2),x, algorithm="maxima")

[Out]

integrate((tan(x) + 3)/sqrt(3*tan(x) + 4), x)

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 65 vs. \(2 (25) = 50\).

Time = 0.33 (sec) , antiderivative size = 65, normalized size of antiderivative = 2.17 \[ \int \frac {3+\tan (x)}{\sqrt {4+3 \tan (x)}} \, dx=\sqrt {2} \arctan \left (\frac {1}{250} \cdot 25^{\frac {3}{4}} \sqrt {10} {\left (3 \cdot 25^{\frac {1}{4}} \sqrt {10} + 10 \, \sqrt {3 \, \tan \left (x\right ) + 4}\right )}\right ) + \sqrt {2} \arctan \left (-\frac {1}{250} \cdot 25^{\frac {3}{4}} \sqrt {10} {\left (3 \cdot 25^{\frac {1}{4}} \sqrt {10} - 10 \, \sqrt {3 \, \tan \left (x\right ) + 4}\right )}\right ) \]

[In]

integrate((3+tan(x))/(4+3*tan(x))^(1/2),x, algorithm="giac")

[Out]

sqrt(2)*arctan(1/250*25^(3/4)*sqrt(10)*(3*25^(1/4)*sqrt(10) + 10*sqrt(3*tan(x) + 4))) + sqrt(2)*arctan(-1/250*
25^(3/4)*sqrt(10)*(3*25^(1/4)*sqrt(10) - 10*sqrt(3*tan(x) + 4)))

Mupad [B] (verification not implemented)

Time = 0.86 (sec) , antiderivative size = 31, normalized size of antiderivative = 1.03 \[ \int \frac {3+\tan (x)}{\sqrt {4+3 \tan (x)}} \, dx=\sqrt {2}\,\left (\mathrm {atan}\left (\sqrt {6\,\mathrm {tan}\left (x\right )+8}\,\left (\frac {1}{10}-\frac {3}{10}{}\mathrm {i}\right )\right )+\mathrm {atan}\left (\sqrt {6\,\mathrm {tan}\left (x\right )+8}\,\left (\frac {1}{10}+\frac {3}{10}{}\mathrm {i}\right )\right )\right ) \]

[In]

int((tan(x) + 3)/(3*tan(x) + 4)^(1/2),x)

[Out]

2^(1/2)*(atan((6*tan(x) + 8)^(1/2)*(1/10 - 3i/10)) + atan((6*tan(x) + 8)^(1/2)*(1/10 + 3i/10)))